﻿@model CountryModel
@using CAF.Mvc.JQuery.Datatables.Core;
@{
    ViewBag.Title = T("Admin.Configuration.Countries").Text;
    var g = Html.GridToolKit();
    var grid = g.DataGrid("countriesGrid", g.Param(x => x.Id)).TableId("table-id").GridKey("Id").Pager()
    .MainGrid(
    g.GridColumn(x => x.Name, 100).DefaultContent("<a href='Edit/#Id#'>#Name#</a>"),
    g.GridColumn(x => x.AllowsBilling, 50),
    g.GridColumn(x => x.AllowsShipping, 50),
    g.GridColumn(x => x.TwoLetterIsoCode, 100),
    g.GridColumn(x => x.ThreeLetterIsoCode, 100),
    g.GridColumn(x => x.NumericIsoCode, 100),
    g.GridColumn(x => x.SubjectToVat, 100),
    g.GridColumn(x => x.NumberOfStates, 100),
    g.GridColumn(x => x.DisplayOrder, 100),
    g.GridColumn(x => x.Published, 100))
    .Url(Url.Action("CountryList", "Country")).DefaultTableClass();
}

@using (Html.BeginForm())
{
    <div class="row">
        <div class="col-md-12">
            <div class="portlet light">
                <div class="section-header sticky">
                    <div class="caption">
                        <i class="icon-equalizer font-red-sunglo"></i>
                        <span class="caption-subject font-red-sunglo bold uppercase">@T("Admin.Configuration.Countries")</span>
                        <span class="caption-helper"></span>
                    </div>
                    <div class="tools">

                    </div>
                    <div class="actions">
                        <a href="@Url.Action("Create")" class="btn yellow"><i class="fa fa-plus"></i>@T("Admin.Common.AddNew") </a>

                    </div>
                </div>
                <div class="portlet-body flip-scroll">

                    <table id="@grid.GetTableId" class="@grid.GetDefaultTableClass" @Html.Raw(grid.GetFixedLayout ? "style='table-layout:fixed'" : "")>
                        <thead>
                            <tr>
                                @foreach (var column in grid.GetColumns)
                                {
                                    if (column.Name == "" + T("Admin.Common.Edit").Text + "")
                                    {

                                        <th class="@column.CssClassHeader">@column.DisplayName</th>

                                    }
                                    else
                                    {
                                        <th class="@column.CssClassHeader">@column.DisplayName</th>
                                    }

                                }
                            </tr>

                        </thead>
                        <tbody></tbody>
                    </table>

                </div>
            </div>
        </div>
    </div>

    <script type="text/javascript">

    @(grid)
    var selectedIds = [];

    $(document).ready(function () {


    });

    </script>
}


